using System;
using System.Collections;
using System.Xml;

namespace InfoJetSoft.Service.Util
{

	class SchemaOtherAttributeCache
	{
		private XmlElement element = null;
		private ArrayList attrList = new ArrayList();

		public SchemaOtherAttributeCache( XmlElement element, XmlAttribute attribute )
		{
			this.element = element;
			foreach( XmlAttribute attr in element.Attributes ){
				if( !attr.Equals( attribute ) ){
					attrList.Add( attr );
				}
			}
			foreach( XmlAttribute attr in this.attrList ){
				element.RemoveAttributeNode( attr );
			}
		}

		public void reset(){
			foreach( XmlAttribute attr in this.attrList ){
				this.element.SetAttributeNode( attr );
			}
		}
	}
}
